[JavaScript] Loading Google Maps API after the page is displayed

Posted by Goro on Stack Overflow See other posts from Stack Overflow or by Goro
Published on 2010-04-23T22:35:14Z Indexed on 2010/04/23 22:43 UTC
Read the original article Hit count: 247

Filed under:
|

Hello,

My landing page contains a big google maps portion, which slows down the loading time. I am trying to do the following:

  1. Load the static elements first so the page loads fast initially.
  2. Display a loading notification in the map placeholder so that the user knows that the map is coming up
  3. Load and display the map

I have done this:

$(document).ready(function() {
  map_initialize();
}

map_initialize() being the function which loads the map into its container div. However, this still will not display the static elements fist. The page will wait until the map_initialize() is finished, then load the static elements at the same time as the map.

Thanks,

© Stack Overflow or respective owner

Related posts about google-maps

Related posts about JavaScript